{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import datasets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3X2sHfV95/H3F7CN7iY0fkp4vNeQEjaJlPJwhUhSdZMmJMh/YKqSLdRNjRZkQZbtrqJd1QgpWpG1NvSPzaq7RVuXpHFqi4fSpnGzUMrjRrsNhEtkMA9rbBwMXnvDBRMKYgvBfPePmVPPOZ5zzpwzT7+Z+byk0TlnZs45vzv3zHzn92zujoiISM9xdSdARETCosAgIiJ9FBhERKSPAoOIiPRRYBARkT4KDCIi0keBQURE+igwiIhIHwUGERHpc0LdCZjGqlWrfM2aNXUnQ0SkUR5//PFX3H31uP0aGRjWrFnDwsJC3ckQEWkUM9ufZT8VJYmISB8FBhER6aPAICIifRQYRESkTyGBwcy+bWYvm9lTQ7avN7Mn4+XvzOxXEtteMLNdZrbTzFSjLCJSs6JyDN8BLhmx/afAP3P3TwBfB7YMbP+su5/r7vMFpUdERKZUSHNVd/+hma0Zsf3vEi8fAU4v4ntFRKR4ddQxXA3ck3jtwN+a2eNmtrGG9EhRtm+HNWvguOOix+3b606RiEyh0g5uZvZZosDwq4nVn3b3g2b2QeA+M/vf7v7DlPduBDYCzM7OVpJemcD27bBxI7z1VvR6//7oNcD69fWlS0QmVlmOwcw+AdwKrHP3V3vr3f1g/Pgy8D3gwrT3u/sWd5939/nVq8f26Jaq3Xjj0aDQ89Zb0XoRaZRKAoOZzQ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6+xwwsxOAX6K+4oax6XX3VxMv/wS4uYJ0TavS32teyYuuu99tZreY2Sp3r21MIjNbQhQUtrv7X6bs0qhj3KOipGI9BpxtZmea2VKiytLKW/rEdgAb4ucbgGNyPGa23MyWxc9XAZ8GnqkshdmOV/LvuBx40ONavRqMTe9A+fGlROXOodoB/G7ccuYi4PVe8WOIzOzkXv2SmV1IdP16dfS7Sk2PAd8CnnX3/zRkt0Yd439Ud+13UxbgN4ii/9vAz4B74/WnAncn9ltL1DrheaIiqLrSuxJ4ANgTP66I188Dt8bPPwXsImpdswu4uoZ0HnO8gJuAS+PnJwJ/DuwFfgycVfPvYFx6/yPwdHxMHwL+aY1pvQ04BPwi/u1eDVwLXBtvN+CP4r9lF0Na2wWU3usTx/YR4FM1p/dXiYqFngR2xsvakI9x1kU9n0VEpI+KkkREpI8Cg4iI9FFgEBGRPgoMIiLSR4FBRET6KDCIiEi0SwkWAAAAEklEQVQfBQYREemjwCAiIn3+P0/C9ES6wQLfAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x25df772f9b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "X, y = datasets.make_moons(noise=0.15, random_state=666)\n",
    "\n",
    "plt.scatter(X[y==0,0], X[y==0,1], color='red')\n",
    "plt.scatter(X[y==1,0], X[y==1,1], color='blue')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.svm import SVC\n",
    "from sklearn.pipeline import Pipeline\n",
    "\n",
    "def RBFKernelSVC(gamma=1.0):\n",
    "    return Pipeline([\n",
    "        ('std_scaler', StandardScaler()),\n",
    "        ('svc', SVC(kernel='rbf', gamma=gamma))\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('svc', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=1.0, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc = RBFKernelSVC(gamma=1.0)\n",
    "svc.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_decision_boundary(model, axis):\n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1]-axis[0])*100)),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3]-axis[2])*100))\n",
    "    )\n",
    "    x_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "    \n",
    "    y_predict = model.predict(x_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#EF9A9A', '#FFF59D', '#90CAF9'])\n",
    "    plt.contourf(x0, x1, zz, linewidth=5, cmap=custom_cmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\fangyang\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAI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ufzSeATBbbvrPMD7AA2Ro+XAt8ADgJ/BVxa0udyWDvtMN7UAAAAeklEQVT/Q/RZfAL4HvD3S2jjvcALwHz02fwE8CngU9HrRvsmVc9GP+fYLL6S2/nprnP5KPBrJbTxH9Oe/vkR8Hj059rQzmfCdqY+nypdISIiQMWmjEREJD8KCCIiAiggiIhIRAFBREQABQQREYkoIIiICKCAICIikf8PqjXQeRTLZYkAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x25df900f7f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc, axis=[-1.5,2.5,-1,1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1], color='red')\n",
    "plt.scatter(X[y==1,0], X[y==1,1], color='blue')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('svc', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=100, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc_gamma100 = RBFKernelSVC(gamma=100)\n",
    "svc_gamma100.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\fangyang\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICA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LdRwFMBV8PQXgkpaNiGwWkbXB11sAvA/1LEtu8vpEy/8BAF/VYKSsRrnljPUd78KwL9c3RwH8epAd8x4AZ8LuRJ+IyNZwnEhEdmB4f3ol+7ecl0EAfB7A06r631MOa/z1NClnodez7tHxjFHz3RhG3h8DeBHAo8HjPwXg4eDrqzDM9HgCwCKGXTjelVPfyET4Bwxr202U860AvgLge8H/Y8Hj2wF8Lvj65wA8GbyeTwL4UI3lu+T1AfBJALuCr9cB+FMAzwD4OwBXNXRd5pXzvwbX4hMA/hrAv2igjPcDeB7AUnBtfgjARwB8JPi5YLhJ1feD9zk1i6/hcn408lp+A8DPNVDGf41h98+3ASwE/2707fU0LKf168mlK4iICEDLuoyIiKg6DAhERASAAYGIiAIMCEREBIABgYiIAgwIREQEgAGBiIgC/wQLkm79kksakAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x25df7b09400>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc_gamma100, axis=[-1.5,2.5,-1,1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1], color='red')\n",
    "plt.scatter(X[y==1,0], X[y==1,1], color='blue')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "     steps=[('std_scaler', StandardScaler(copy=True, with_mean=True, with_std=True)), ('svc', SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,\n",
       "  decision_function_shape='ovr', degree=3, gamma=10, kernel='rbf',\n",
       "  max_iter=-1, probability=False, random_state=None, shrinking=True,\n",
       "  tol=0.001, verbose=False))])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svc_gamma10 = RBFKernelSVC(gamma=10)\n",
    "svc_gamma10.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\fangyang\\Anaconda3\\lib\\site-packages\\matplotlib\\contour.py:967: UserWarning: The following kwargs were not used by contour: 'linewidth'\n",
      "  s)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XuMHVd9B/Dvb5eNDSHE3rjEIcSEqBFNrFYLsbw8qioqtApJ5eACioMNCwJtaUDYCKSuQCKYqqmpUIVRSKkhwCZxE1Mag2lCUp6iosRg0IZkEx4moo1xHiR+4NgJ3uz++sedWd+9O3PvzJ1z5jzm+5FWvnvv7J3juXPndx6/c0ZUFURERAOuC0BERH5gQCAiIgAMCERElGBAICIiAAwIRESUYEAgIiIAhgKCiHxeRB4XkftzXr9URI6KyFTy8xET+yUiInOeY+h9vgjgegA3ddnmv1X1rwztj4iIDDPSQlDV7wE4ZOK9iIjIDVMthCJeJSL3AjgI4IOqOt25gYiMAxgHgNOee/olZ7/kZTUWj4gofA//7CdPqOof9PO3dQWEnwB4iao+JSKXA/gKgAs7N1LVHQB2AMCqiy7RD9z0g5qKR0QUhy1rl/xvv39bS5aRqv5OVZ9KHt8JYEhEVtSxbyIiKqaWFoKIrATwmKqqiKxFKxA9Wce+yayxqclC202OjFkuCRGZZiQgiMitAC4FsEJEDgC4FsAQAKjqZwC8CcDfisizAJ4GsEG5zKp3Nq++BUd2zhp5r26Bg8GCyE9GAoKqXt3j9evRSkslhzavvmX+cdaF/8hUPeVoDxbLNg7OP94+vameAhBRpjqzjKhG7Rd/oBUA6rrgl9EemMYwiWUbBxkYiBxhQIhMGghMdf3U7cjOWWzee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gzL+KVrdPz8FMJX8XO7b8SxYztLHk0tXEBERgMC6jIiIyB4GBCIiAsCAQERECQYEIiICwIBAREQJBgQiIgLAgEBERIn/B8Thnx3LYsdNAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x25df793fd30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(svc_gamma10, axis=[-1.5,2.5,-1,1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1], color='red')\n",
    "plt.scatter(X[y==1,0], X[y==1,1], color='blue')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
